#ifndef LOGIN_H
#define	LOGIN_H

#include <iostream>
#include <fstream>
#include <list>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <cstdlib>

using namespace std;

class Login {
public:
    Login();

    int getLoginTries() {
        return loginTries;
    };

    void increaseLoginTries() {
        loginTries++;
    };

    void changePassword(); //Runs when user wants to change password
    void adminInterface(); //For admin menu
    void studentInterface(); //For student menu
    void lecturerInterface(); //For lectuerer menu
    int getLogin();        //Runs to get username and password from user
    void updateDetails();  //Updates the cashier textfile

    int getLoginIndex() {
        return loginIndex;
    }
    string getRole() {
        return role;
    }
    string getUser() {
        return username;
    }

private:
    void getLoginDetails();       //Save details from text file to list: cashier
    int checkValidUserPass(string, string); //Returns -1 if successful
    string decryptPass(string);             // Returns a decrypted password
    string encryptPass(string);             // Returns an encrypted password
    int loginTries;                         //Number of time login failed
    int loginIndex;                       //Index of cashier that logged in
    string role;                        //role of user
    string username; // user
};


#endif	/* LOGIN_H */